package com.xin.util;

import com.github.stuxuhai.jpinyin.PinyinException;
import com.github.stuxuhai.jpinyin.PinyinFormat;
import com.github.stuxuhai.jpinyin.PinyinHelper;

/**
 * created by l1 on 2017/10/25.
 */
public class PinYinUtil {
    public static String convertPY(String chinese){
        try {
            String pinyin = PinyinHelper.convertToPinyinString(chinese, "", PinyinFormat.WITHOUT_TONE);
            return pinyin;
        } catch (PinyinException e) {
            e.printStackTrace();
        }
        return null;
    }
}
